package com.gin.kotlin.no_gay_alliance.model

import android.os.Parcelable
import com.gin.nga.enums.ForumType
import com.gin.nga.response.forum.FavorForum
import com.gin.nga.response.resource.index.ForumEntry
import kotlinx.parcelize.Parcelize

@Parcelize
class ForumEntryModel(
    /**
     * 类型
     */
    var type: ForumType,
    /**
     * id
     */
    var entryId: Long,
    /**
     * 名称
     */
    var name: String,
    /**
     * 图标
     */
    var icon: String,
    /**
     * 备注
     */
    var remark: String? = null,
) : Parcelable {
    constructor() : this(ForumType.FORUM, 0,"","")

    constructor(entry: ForumEntry) : this(
        if (entry.forumId != null) ForumType.FORUM else ForumType.COL,
        entry.colTid ?: entry.forumId!!,
        entry.name!!,
        entry.getBigIconUrl()!!,
        entry.info,
    )

     constructor(entry: FavorForum) : this(
         if (entry.forumId != null) ForumType.FORUM else ForumType.COL,
        entry.colTid ?: entry.forumId!!,
        entry.name!!,
        entry.getBigIconUrl()!!,
        entry.info,
    )


}